package com.boot.core.protocol

class ConnRequestOfApp {
    val jsonrpc: String = "2.0"
    var id: String? = null
    var method: String? = null
    var params: ConnParamsOfApp? = null
//    var sign: String? = ""

    fun ConnRequestOfApp(connRequestOfApp: ConnRequestOfApp?) {
        this.id = connRequestOfApp?.id
        this.method = connRequestOfApp?.method
        if (connRequestOfApp != null) {
            this.params = ConnParamsOfApp(connRequestOfApp.params)
        }
    }


    class ConnParamsOfApp(connParamsOfApp: ConnParamsOfApp?) {
        // 此处应看前端传入参数是否为json字符串
        var data: Data? = connParamsOfApp?.data
        var sign: String? = ""

        class Data(data: Data?) {
            var sessionId: String? = data?.sessionId
            var version: String? = data?.version
            var appId: String? = data?.appId
            var timestamp: String? = data?.timestamp
            var nonce: String? = data?.nonce
        }

    }

}